package com.slz3.business.module.goodsManagement.gooBaseGoodsSpecification.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.goodsManagement.gooBaseGoodsSpecification.domain.GooBaseGoodsSpecification;
import com.slz3.business.module.goodsManagement.gooBaseGoodsSpecification.domain.GooBaseGoodsSpecificationCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

@Controller
public class GooBaseGoodsSpecificationResController  {

    @Resource
    private GooBaseGoodsSpecificationResAtomic gooBaseGoodsSpecificationResAtomic;

    public Mono<ServerResponse> add(ServerRequest req, GooBaseGoodsSpecification gooBaseGoodsSpecification) {
        if (GooBaseGoodsSpecificationResUnsafeValid.add(req, gooBaseGoodsSpecification)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationResAtomic.add_$GooBaseGoodsSpecificationUpdateLock(req, gooBaseGoodsSpecification);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, GooBaseGoodsSpecificationCondition gooBaseGoodsSpecificationCondition) {
        if (GooBaseGoodsSpecificationResUnsafeValid.delete(req, gooBaseGoodsSpecificationCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationResAtomic.delete_$GooBaseGoodsSpecificationUpdateLock(req, gooBaseGoodsSpecificationCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, GooBaseGoodsSpecification gooBaseGoodsSpecification) {
        if (GooBaseGoodsSpecificationResUnsafeValid.modify(req, gooBaseGoodsSpecification)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationResAtomic.modify_$GooBaseGoodsSpecificationUpdateLock(req, gooBaseGoodsSpecification);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (GooBaseGoodsSpecificationResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return GooBaseGoodsSpecificationResExecutor.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return gooBaseGoodsSpecificationResAtomic.info_$GooBaseGoodsSpecificationUpdateLock(req);
        if (GooBaseGoodsSpecificationResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationResAtomic.info_$GooBaseGoodsSpecificationUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (GooBaseGoodsSpecificationResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return GooBaseGoodsSpecificationResExecutor.choice(req);
        }
    }

    public Mono<ServerResponse> findByFkGooBaseGoodsUuid(ServerRequest req) {
        if (GooBaseGoodsSpecificationResUnsafeValid.findByFkGooBaseGoodsUuid(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return GooBaseGoodsSpecificationResExecutor.findByFkGooBaseGoodsUuid(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, GooBaseGoodsSpecificationCondition gooBaseGoodsSpecificationCondition) {
        //
        if (GooBaseGoodsSpecificationResUnsafeValid.auditSubmit(req, gooBaseGoodsSpecificationCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationResAtomic.auditSubmit_$GooBaseGoodsSpecificationUpdateLock(req, gooBaseGoodsSpecificationCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, GooBaseGoodsSpecificationCondition gooBaseGoodsSpecificationCondition) {
        if (GooBaseGoodsSpecificationResUnsafeValid.audit(req, gooBaseGoodsSpecificationCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationResAtomic.audit_$GooBaseGoodsSpecificationUpdateLock(req, gooBaseGoodsSpecificationCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, GooBaseGoodsSpecificationCondition gooBaseGoodsSpecificationCondition) {
        if (GooBaseGoodsSpecificationResUnsafeValid.auditReject(req, gooBaseGoodsSpecificationCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationResAtomic.auditReject_$GooBaseGoodsSpecificationUpdateLock(req, gooBaseGoodsSpecificationCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, GooBaseGoodsSpecificationCondition gooBaseGoodsSpecificationCondition) {
        if (GooBaseGoodsSpecificationResUnsafeValid.usingEnable(req, gooBaseGoodsSpecificationCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationResAtomic.usingEnable_$GooBaseGoodsSpecificationUpdateLock(req, gooBaseGoodsSpecificationCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, GooBaseGoodsSpecificationCondition gooBaseGoodsSpecificationCondition) {
        if (GooBaseGoodsSpecificationResUnsafeValid.usingDisable(req, gooBaseGoodsSpecificationCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return gooBaseGoodsSpecificationResAtomic.usingDisable_$GooBaseGoodsSpecificationUpdateLock(req, gooBaseGoodsSpecificationCondition);
        }
    }

}
